$(function(){
    var WinHeigh = $(window).height();
   // $("[name='p1']").height(WinHeigh);
    Screen.OnReSize(function(ResizedWinWidth, ResizedWinHeight, scale){
        $("[name='p1']").height(ResizedWinHeight-$("#NavMenu").height());
    })
});

var Screen = function(CB) {
    var WinWidth = $(window).width();
    var WinHeigh = $(window).height();

    var OnReSize = function(CB) {
        var ResizedWinWidth = $(window).width();
        var ResizedWinHeight = $(window).height();
        var scale_w = ResizedWinWidth / WinWidth;
        var scale_h = ResizedWinHeight / WinHeigh;
        var scale = scale_w >= scale_h ? scale_h : scale_w;
        if (CB) {
            CB(ResizedWinWidth, ResizedWinHeight, scale);
        }
        window.onresize = function() {
            OnReSize(CB);
        }
    };

    return {
        OnReSize: OnReSize
    }


}();